This file is part of the supplementary material of the manuscript: Didino, D., Brandtner, M., & Knops, A. (2021). No influence of masked priming on the multiplication fact retrieval in a result verification task.
This script reports the analysis for experiment 3.
Dataset loaded: exp3_data.rds (data of result verification task)
Load libraries, my functions (my_functions folder) and data (data/processed folder):
library('ggpubr')
#> Loading required package: ggplot2
library('here')
#> here() starts at D:/mult_prime
library('kableExtra')
# library('knitr')
library('plotly')
#>
#> Attaching package: 'plotly'
#> The following object is masked from 'package:ggplot2':
#>
#> last_plot
#> The following object is masked from 'package:stats':
#>
#> filter
#> The following object is masked from 'package:graphics':
#>
#> layout
library('ggridges')
library('tidyverse')
#> -- Attaching packages --------------------------------------- tidyverse 1.3.1 --
#> v tibble 3.1.0 v dplyr 1.0.5
#> v tidyr 1.1.3 v stringr 1.4.0
#> v readr 1.4.0 v forcats 0.5.1
#> v purrr 0.3.4
#> -- Conflicts ------------------------------------------ tidyverse_conflicts() --
#> x dplyr::filter() masks plotly::filter(), stats::filter()
#> x dplyr::group_rows() masks kableExtra::group_rows()
#> x dplyr::lag() masks stats::lag()
library('BayesFactor')
#> Loading required package: coda
#> Loading required package: Matrix
#>
#> Attaching package: 'Matrix'
#> The following objects are masked from 'package:tidyr':
#>
#> expand, pack, unpack
#> ************
#> Welcome to BayesFactor 0.9.12-4.2. If you have questions, please contact Richard Morey (richarddmorey@gmail.com).
#>
#> Type BFManual() to open the manual.
#> ************
# Load my functions
source(here('funcs', 'load_my_functions.R'))
# Load data
exp3 <- readRDS(here('data', 'processed', 'exp3_data.rds'))
Exclude outliers
exp3 <-
exp3 %>%
filter(outlier == FALSE)
exp3_dRT <-
exp3 %>%
return_delta_RT(.,
y_col = RT,
cols_to_group = c('sj', 'problem_size', 'SOA'),
cols_to_subtract = c('prime_cond'),
neutral_cond = 'neutral')
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.
dens_RT <-
ggplot(exp3, aes(RT)) +
geom_density() +
stat_function(fun = dnorm,
args = list(mean = mean(exp3$RT), sd = sd(exp3$RT)),
color = 'blue') +
ggtitle('')
dens_dRT <-
ggplot(exp3_dRT, aes(dRT)) +
geom_density() +
stat_function(fun = dnorm,
args = list(mean = mean(exp3_dRT$dRT), sd = sd(exp3_dRT$dRT)),
color = 'blue') +
ggtitle('')
ggarrange(dens_RT,
dens_dRT,
ncol = 2,
nrow = 1,
labels = c('RT', 'delta RT'))
Table with RTs mean, standard deviation and standard error (aggregated on subject and condition):
# Calculate statistics
exp3_stats <-
exp3_dRT %>%
return_stats(c('problem_size', 'SOA', 'cond'),
DV = 'dRT')
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.
#> `summarise()` has grouped output by 'problem_size', 'SOA'. You can override using the `.groups` argument.
# Show results
exp3_stats %>%
make_table('Statistics (prime condition by problem size)')
| problem_size | SOA | cond | N_sj | Mean | SD | SE |
|---|---|---|---|---|---|---|
| large | SOA_050 | neigh_con | 29 | -7.98 | 72.01 | 13.37 |
| large | SOA_050 | neigh_inc | 29 | -14.92 | 78.15 | 14.51 |
| large | SOA_050 | unrel_con | 29 | -16.43 | 73.32 | 13.62 |
| large | SOA_050 | unrel_inc | 29 | 1.24 | 69.72 | 12.95 |
| large | SOA_170 | neigh_con | 29 | 15.83 | 76.29 | 14.17 |
| large | SOA_170 | neigh_inc | 29 | 26.18 | 57.07 | 10.60 |
| large | SOA_170 | unrel_con | 29 | -12.18 | 69.37 | 12.88 |
| large | SOA_170 | unrel_inc | 29 | -18.45 | 61.55 | 11.43 |
| large | SOA_220 | neigh_con | 29 | -13.21 | 60.76 | 11.28 |
| large | SOA_220 | neigh_inc | 29 | -8.52 | 82.48 | 15.32 |
| large | SOA_220 | unrel_con | 29 | -20.40 | 74.26 | 13.79 |
| large | SOA_220 | unrel_inc | 29 | 14.56 | 71.36 | 13.25 |
| small | SOA_050 | neigh_con | 29 | 21.64 | 43.10 | 8.00 |
| small | SOA_050 | neigh_inc | 29 | 46.01 | 81.12 | 15.06 |
| small | SOA_050 | unrel_con | 29 | 12.15 | 58.70 | 10.90 |
| small | SOA_050 | unrel_inc | 29 | 16.69 | 61.44 | 11.41 |
| small | SOA_170 | neigh_con | 29 | 5.70 | 49.85 | 9.26 |
| small | SOA_170 | neigh_inc | 29 | 9.76 | 43.79 | 8.13 |
| small | SOA_170 | unrel_con | 29 | -0.98 | 53.02 | 9.85 |
| small | SOA_170 | unrel_inc | 29 | 23.64 | 72.35 | 13.44 |
| small | SOA_220 | neigh_con | 29 | 8.44 | 64.71 | 12.02 |
| small | SOA_220 | neigh_inc | 29 | 25.80 | 69.28 | 12.87 |
| small | SOA_220 | unrel_con | 29 | 6.14 | 46.64 | 8.66 |
| small | SOA_220 | unrel_inc | 29 | 21.40 | 55.40 | 10.29 |
RTs distribution across prime conditions:
plot_1 <-
exp3_dRT %>%
ggplot(aes(dRT, fill = cond)) +
geom_density(alpha = 0.6) +
facet_wrap(~ SOA + problem_size, ncol = 2) +
theme(panel.spacing = unit(2, "cm"))
ggplotly(plot_1)
exp3_dRT %>%
ggplot(aes(x = dRT, y = cond, fill = stat(x))) +
geom_density_ridges_gradient(scale = 3) +
scale_fill_viridis_c(name = 'RTs', option = 'C') +
labs(y = 'Prime condition') +
facet_wrap(~ SOA + problem_size, ncol = 2)
#> Picking joint bandwidth of 19.8
#> Picking joint bandwidth of 17.9
#> Picking joint bandwidth of 21.7
#> Picking joint bandwidth of 18.9
#> Picking joint bandwidth of 25.8
#> Picking joint bandwidth of 17.9
Bayes factors are computer with the package BayesFactor.
tribble(
~BF, ~Evidence,
'0-3', 'Anectodal',
'3-10', 'Moderate',
'10-30', 'Strong',
'30-100', 'Very_strong',
'>100', 'Decisive') %>%
make_table('Bayes factor interpretation')
| BF | Evidence |
|---|---|
| 0-3 | Anectodal |
| 3-10 | Moderate |
| 10-30 | Strong |
| 30-100 | Very_strong |
| >100 | Decisive |
exp3_bf <-
exp3_dRT %>%
group_by(problem_size, SOA, cond) %>%
nest() %>%
mutate(
# "DV" is the column with the means returned by "return_means()"
BF_test = map(data,
~ttestBF(x = .$dRT,
mu = 0)),
BF_value = map(BF_test,
~extractBF(.) %>%
tibble %>%
select(bf, error))
) %>%
unnest(BF_value)
exp3_bf
#> # A tibble: 24 x 7
#> # Groups: problem_size, SOA, cond [24]
#> problem_size SOA cond data BF_test bf error
#> <chr> <chr> <chr> <list> <list> <dbl> <dbl>
#> 1 large SOA_050 neigh_con <tibble[,2] [29 x~ <BFBysFc~ 0.233 1.11e-5
#> 2 large SOA_050 neigh_inc <tibble[,2] [29 x~ <BFBysFc~ 0.319 9.47e-5
#> 3 large SOA_050 unrel_con <tibble[,2] [29 x~ <BFBysFc~ 0.381 1.40e-4
#> 4 large SOA_050 unrel_inc <tibble[,2] [29 x~ <BFBysFc~ 0.198 1.23e-5
#> 5 large SOA_170 neigh_con <tibble[,2] [29 x~ <BFBysFc~ 0.348 1.18e-4
#> 6 large SOA_170 neigh_inc <tibble[,2] [29 x~ <BFBysFc~ 2.56 5.66e-8
#> 7 large SOA_170 unrel_con <tibble[,2] [29 x~ <BFBysFc~ 0.297 7.44e-5
#> 8 large SOA_170 unrel_inc <tibble[,2] [29 x~ <BFBysFc~ 0.627 9.21e-8
#> 9 large SOA_220 neigh_con <tibble[,2] [29 x~ <BFBysFc~ 0.367 1.31e-4
#> 10 large SOA_220 neigh_inc <tibble[,2] [29 x~ <BFBysFc~ 0.228 7.05e-6
#> # ... with 14 more rows
exp3_bf <-
exp3_bf %>%
select(problem_size, SOA, cond, bf) %>%
rename(BF_10 = bf) %>%
mutate(
BF_01 = 1 / BF_10
)
# Show results
exp3_bf %>%
make_table('Bayes factor')
| problem_size | SOA | cond | BF_10 | BF_01 |
|---|---|---|---|---|
| large | SOA_050 | neigh_con | 0.23 | 4.30 |
| large | SOA_050 | neigh_inc | 0.32 | 3.13 |
| large | SOA_050 | unrel_con | 0.38 | 2.62 |
| large | SOA_050 | unrel_inc | 0.20 | 5.05 |
| large | SOA_170 | neigh_con | 0.35 | 2.88 |
| large | SOA_170 | neigh_inc | 2.56 | 0.39 |
| large | SOA_170 | unrel_con | 0.30 | 3.37 |
| large | SOA_170 | unrel_inc | 0.63 | 1.59 |
| large | SOA_220 | neigh_con | 0.37 | 2.72 |
| large | SOA_220 | neigh_inc | 0.23 | 4.39 |
| large | SOA_220 | unrel_con | 0.52 | 1.91 |
| large | SOA_220 | unrel_inc | 0.34 | 2.93 |
| small | SOA_050 | neigh_con | 4.04 | 0.25 |
| small | SOA_050 | neigh_inc | 8.35 | 0.12 |
| small | SOA_050 | unrel_con | 0.35 | 2.89 |
| small | SOA_050 | unrel_inc | 0.51 | 1.95 |
| small | SOA_170 | neigh_con | 0.23 | 4.26 |
| small | SOA_170 | neigh_inc | 0.38 | 2.64 |
| small | SOA_170 | unrel_con | 0.20 | 5.04 |
| small | SOA_170 | unrel_inc | 0.77 | 1.30 |
| small | SOA_220 | neigh_con | 0.25 | 4.04 |
| small | SOA_220 | neigh_inc | 1.13 | 0.89 |
| small | SOA_220 | unrel_con | 0.25 | 4.02 |
| small | SOA_220 | unrel_inc | 1.28 | 0.78 |
Create a single data frame with dRT and mean RT (a data point for each subject, problem size and prime condition)
# Mean RT by subject
exp3_meanRT_sj <-
exp3 %>%
return_stats(c('sj', 'problem_size', 'SOA', 'cond'),
DV = 'RT') %>%
select(sj, problem_size, SOA, prime_cond, Mean) %>%
rename(cond = prime_cond) %>%
filter(cond != 'neutral')
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.
#> `summarise()` has grouped output by 'sj', 'problem_size', 'SOA'. You can override using the `.groups` argument.
# Join data frames
exp3_dRT_meanRT <-
full_join(exp3_dRT,
exp3_meanRT_sj,
by = c('sj', 'problem_size', 'SOA', 'cond'))
Plot for large problems
exp3_dRT_meanRT %>%
filter(problem_size == 'large') %>%
ggplot(aes(Mean, dRT)) +
geom_point() +
geom_hline(yintercept = 0,
linetype = 'dashed',
color = 'red',
size = 0.5) +
facet_wrap(~ cond + SOA, ncol = 3)
Plot for small problems
exp3_dRT_meanRT %>%
filter(problem_size == 'small') %>%
ggplot(aes(Mean, dRT)) +
geom_point() +
geom_hline(yintercept = 0,
linetype = 'dashed',
color = 'red',
size = 0.5) +
facet_wrap(~ cond + SOA, ncol = 3)
xfun::session_info()
#> R version 4.0.5 (2021-03-31)
#> Platform: x86_64-w64-mingw32/x64 (64-bit)
#> Running under: Windows 10 x64 (build 19044)
#>
#> Locale:
#> LC_COLLATE=English_United Kingdom.1252
#> LC_CTYPE=English_United Kingdom.1252
#> LC_MONETARY=English_United Kingdom.1252
#> LC_NUMERIC=C
#> LC_TIME=English_United Kingdom.1252
#>
#> Package version:
#> abind_1.4-5 askpass_1.1 assertthat_0.2.1
#> backports_1.2.1 base64enc_0.1.3 BayesFactor_0.9.12-4.2
#> BH_1.75.0.0 blob_1.2.1 boot_1.3.27
#> broom_0.7.6 bslib_0.2.4 callr_3.6.0
#> car_3.0-10 carData_3.0-4 cellranger_1.1.0
#> cli_2.4.0 clipr_0.7.1 coda_0.19-4
#> colorspace_2.0-0 compiler_4.0.5 conquer_1.0.2
#> contfrac_1.1.12 corrplot_0.84 cowplot_1.1.1
#> cpp11_0.2.7 crayon_1.4.1 crosstalk_1.1.1
#> curl_4.3 data.table_1.14.0 DBI_1.1.1
#> dbplyr_2.1.1 deSolve_1.28 digest_0.6.27
#> dplyr_1.0.5 dtplyr_1.1.0 ellipsis_0.3.1
#> elliptic_1.4.0 evaluate_0.14 fansi_0.4.2
#> farver_2.1.0 forcats_0.5.1 foreign_0.8-81
#> fs_1.5.0 gargle_1.1.0 generics_0.1.0
#> ggplot2_3.3.5 ggpubr_0.4.0 ggrepel_0.9.1
#> ggridges_0.5.3 ggsci_2.9 ggsignif_0.6.1
#> glue_1.4.2 googledrive_1.0.1 googlesheets4_0.3.0
#> graphics_4.0.5 grDevices_4.0.5 grid_4.0.5
#> gridExtra_2.3 gtable_0.3.0 gtools_3.8.2
#> haven_2.3.1 here_1.0.1 highr_0.8
#> hms_1.0.0 htmltools_0.5.1.1 htmlwidgets_1.5.3
#> httr_1.4.2 hypergeo_1.2.13 ids_1.0.1
#> isoband_0.2.4 jquerylib_0.1.3 jsonlite_1.7.2
#> kableExtra_1.3.4 knitr_1.33 labeling_0.4.2
#> later_1.1.0.1 lattice_0.20-41 lazyeval_0.2.2
#> lifecycle_1.0.0 lme4_1.1.26 lubridate_1.7.10
#> magrittr_2.0.1 maptools_1.1.1 markdown_1.1
#> MASS_7.3.53.1 Matrix_1.3-2 MatrixModels_0.5-0
#> matrixStats_0.58.0 methods_4.0.5 mgcv_1.8.34
#> mime_0.10 minqa_1.2.4 modelr_0.1.8
#> munsell_0.5.0 mvtnorm_1.1-1 nlme_3.1.152
#> nloptr_1.2.2.2 nnet_7.3.15 numDeriv_2016.8.1.1
#> openssl_1.4.3 openxlsx_4.2.3 parallel_4.0.5
#> pbapply_1.4-3 pbkrtest_0.5.1 pillar_1.6.0
#> pkgconfig_2.0.3 plotly_4.9.3 plyr_1.8.6
#> polynom_1.4.0 prettyunits_1.1.1 processx_3.5.1
#> progress_1.2.2 promises_1.2.0.1 ps_1.6.0
#> purrr_0.3.4 quantreg_5.85 R6_2.5.0
#> rappdirs_0.3.3 RColorBrewer_1.1.2 Rcpp_1.0.6
#> RcppArmadillo_0.10.2.2.0 RcppEigen_0.3.3.9.1 readr_1.4.0
#> readxl_1.3.1 rematch_1.0.1 rematch2_2.1.2
#> reprex_2.0.0 rio_0.5.26 rlang_0.4.10
#> rmarkdown_2.7 rprojroot_2.0.2 rstatix_0.7.0
#> rstudioapi_0.13 rvest_1.0.0 sass_0.3.1
#> scales_1.1.1 selectr_0.4.2 sp_1.4.5
#> SparseM_1.81 splines_4.0.5 statmod_1.4.35
#> stats_4.0.5 stringi_1.5.3 stringr_1.4.0
#> svglite_2.0.0 sys_3.4 systemfonts_1.0.2
#> tibble_3.1.0 tidyr_1.1.3 tidyselect_1.1.0
#> tidyverse_1.3.1 tinytex_0.31 tools_4.0.5
#> utf8_1.2.1 utils_4.0.5 uuid_0.1.4
#> vctrs_0.3.7 viridisLite_0.3.0 webshot_0.5.2
#> withr_2.4.1 xfun_0.22 xml2_1.3.2
#> yaml_2.2.1 zip_2.1.1